import request from '@/utils/request'

// @Tags api
// @Summary 角色权限列表
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body modelInterface.PageInfo true "用户登录"
// @Success 200 {string} json "{"code":0,"data":{},"msg":"获取成功"}"
// @Router /api/role/menu/list [get]
export const getRoleMenuList = (data) => {
  return request({
    url: '/api/role/list',
    method: 'Get'
  })
}

// @Tags api
// @Summary 角色列表
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body modelInterface.PageInfo true "角色列表"
// @Success 200 {string} json "{"code":0,"data":{},"msg":"获取成功"}"
// @Router /api/role/list [get]
export const getRoleList = (data) => {
  return request({
    url: '/api/role/all/list',
    method: 'Get',
    data
  })
}

// @Tags api
// @Summary 添加角色成员
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body modelInterface.PageInfo true "添加角色成员"
// @Success 200 {string} json "{"code":0,"data":{},"msg":"获取成功"}"
// @Router /api/role/user/add [post]
export const addRole = (data) => {
  return request({
    url: '/api/role/add',
    method: 'Post',
    data
  })
}
export const updateRole = (data) => {
  return request({
    url: '/api/role/update',
    method: 'Post',
    data
  })
}
export const deleteRole = (RoleId) => {
  return request({
    url: `/api/role/delete/${RoleId}`,
    method: 'Get',
  })
}
export const addRoleUser = (data) => {
  return request({
    url: '/api/role/user/add',
    method: 'Post',
    data
  })
}
export const setRolemenu = (data) => {
  return request({
    url: '/api/role/menu/set',
    method: 'Post',
    data
  })
}